package com.gold.entity;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

/**
 * @author XiaoHao
 * @date 2022-05-10 13:55
 */
@TableName("card_info")
public class CardInfo {
    @TableId(type = IdType.AUTO)
    private Integer id;
    private String name;
    //类型（W：周卡 7天，M：月卡 30天，S：季卡 90天，Y：年卡 365天）
    private String type;
    //创建时间
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;
    //使用时间
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private Date useTime;
    //到期时间
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private Date endTime;
    private Integer days;
    //卡密状态，0正常，1已使用，2过期
    private String status;

    //接收前端 生成卡密个数
    @TableField(exist = false)
    private Integer number;

    public Integer getNumber() {
        return number;
    }

    public void setNumber(Integer number) {
        this.number = number;
    }

    public Integer getDays() {
        return days;
    }

    public void setDays(Integer days) {
        this.days = days;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public CardInfo() {
    }

    @Override
    public String toString() {
        return "CardInfo{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", type='" + type + '\'' +
                ", createTime=" + createTime +
                ", useTime=" + useTime +
                ", endTime=" + endTime +
                ", days=" + days +
                '}';
    }

    public Date getUseTime() {
        return useTime;
    }

    public void setUseTime(Date useTime) {
        this.useTime = useTime;
    }

    public CardInfo(Integer id, String name, String type, Date createTime, Date useTime, Date endTime, Integer days) {
        this.id = id;
        this.name = name;
        this.type = type;
        this.createTime = createTime;
        this.useTime = useTime;
        this.endTime = endTime;
        this.days = days;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }


    public Date getEndTime() {
        return endTime;
    }

    public void setEndTime(Date endTime) {
        this.endTime = endTime;
    }

}
